// test.ts

import { MockMethod } from 'vite-plugin-mock'
export default [
    {
        url: '/api/login',
        method: 'post',
        timeout: 2000,
        response: ({ body }) => {
            console.log(body);

            if (body.name === 'admin' && body.password === '123456') {
                return {
                    code: 200,
                    data: {
                        name: body.name,
                        token: 'dsadsadscxc4561xsad'
                    },
                    msg: '登录成功'
                }
            } else {
                return {
                    code: 0,
                    data: {

                    },
                    msg: '用户名或密码错误'
                }
            }
        },
    }
] as MockMethod[]